package com.pactera.madp.cp.api.em.wechat;

/**
 * @Author: yushen.qi
 * @Date: 2021/08/02/14:44
 * @Description:
 */
public enum AuthorizerCode {
    /**
     * @Message("订阅号")
     */
    one(0,"订阅号"),

    /**
     * @Message("由历史老帐号升级后的订阅号")
     */
    two(1,"由历史老帐号升级后的订阅号"),

    /**
     * @Message("服务号")
     */
    three(2,"服务号");

    private int code;
    private String msg;

    AuthorizerCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    /**
     * 根据 code 值获取对应的msg
     *
     * @param code
     * @return msg
     */
    public static String getTypeByCode(Integer code) {
        AuthorizerCode[] values = values();
        for (AuthorizerCode e : values) {
            if (e.getCode() == code) {
                return e.getMsg();
            }
        }
        return "";
    }

}
